home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Visual Database / Visual dBase Pro v7.0 / DATA1.CAB / Sample_Include / Winreg.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-11-20  |  6.2 KB  |  180 lines

  1. //--------------------------------------------------------------
  2. //
  3. //  WINREG.H
  4. //
  5. //    This file contains the constant and type definitions 
  6. //    for the Windows 32-Bit Registry API. This is a subset
  7. //    of WINNT.H
  8. //
  9. //  Visual dBASE Samples Group
  10. //
  11. //  $Revision:   1.3  $
  12. //
  13. //  Portions copyright (c) 1991-1995, Microsoft Corp. 
  14. //
  15. //--------------------------------------------------------------
  16.  
  17. #ifndef WINNT_H
  18. #ifndef _WINREG_
  19. #define _WINREG_
  20.  
  21. #include "windef.h"
  22.  
  23. //
  24. // Requested Key access mask type.
  25. //
  26.  
  27. #define REGSAM DWORD
  28.  
  29. //
  30. // Type definitions.
  31. //
  32.  
  33. #define HKEY  HANDLE
  34. #define PHKEY PHANDLE
  35.  
  36. //
  37. // Reserved Key Handles.
  38. //
  39.  
  40. #define HKEY_CLASSES_ROOT           (0x80000000)
  41. #define HKEY_CURRENT_USER           (0x80000001)
  42. #define HKEY_LOCAL_MACHINE          (0x80000002)
  43. #define HKEY_USERS                  (0x80000003)
  44. #define HKEY_PERFORMANCE_DATA       (0x80000004)
  45. #define HKEY_CURRENT_CONFIG         (0x80000005)
  46. #define HKEY_DYN_DATA               (0x80000006)
  47.  
  48. #define PROVIDER_KEEPS_VALUE_LENGTH 0x1
  49.  
  50. #define PVALCONTEXT PSTRUCTURE
  51.  
  52. #define PVALUE STRUCTURE
  53. #define PPVALUEA PSTRUCTURE
  54.  
  55. #define QUERYHANDLER  NEARPROC
  56. #define PQUERYHANDLER FARPROC
  57.  
  58. #define REG_PROVIDER STRUCTURE
  59. #define PPROVIDER    PSTRUCTURE
  60.  
  61. #define VALENT  STRUCTURE
  62. #define PVALENT PSTRUCTURE
  63.  
  64. // From winnt.h
  65. //
  66. //  The following are masks for the predefined standard access types
  67. //
  68.  
  69. // #define DELETE                           (0x00010000) // conflicts with 
  70. //                                                       // DELETE command
  71. #define READ_CONTROL                     (0x00020000)
  72. #define WRITE_DAC                        (0x00040000)
  73. #define WRITE_OWNER                      (0x00080000)
  74. #define SYNCHRONIZE                      (0x00100000)
  75.  
  76. #define STANDARD_RIGHTS_REQUIRED         (0x000F0000)
  77.  
  78. #define STANDARD_RIGHTS_READ             (READ_CONTRO)
  79. #define STANDARD_RIGHTS_WRITE            (READ_CONTRO)
  80. #define STANDARD_RIGHTS_EXECUTE          (READ_CONTRO)
  81.  
  82. #define STANDARD_RIGHTS_ALL              (0x001F0000)
  83.  
  84. #define SPECIFIC_RIGHTS_ALL              (0x0000FFFF)
  85.  
  86. //
  87. // Registry Specific Access Rights.
  88. //
  89.  
  90. #define KEY_QUERY_VALUE         (0x0001)
  91. #define KEY_SET_VALUE           (0x0002)
  92. #define KEY_CREATE_SUB_KEY      (0x0004)
  93. #define KEY_ENUMERATE_SUB_KEYS  (0x0008)
  94. #define KEY_NOTIFY              (0x0010)
  95. #define KEY_CREATE_LINK         (0x0020)
  96.  
  97. #define KEY_READ                (bitand(bitor(bitor(bitor(STANDARD_RIGHTS_READ, KEY_QUERY_VALUE), KEY_ENUMERATE_SUB_KEYS), KEY_NOTIFY), BITNOT( SYNCHRONIZE ) ) )
  98. #define KEY_WRITE               (bitand(bitor(bitor(STANDARD_RIGHTS_WRITE, KEY_SET_VALUE), KEY_CREATE_SUB_KEY), BITNOT( SYNCHRONIZE) ) )
  99. #define KEY_EXECUTE             (bitand(KEY_READ, BITNOT( SYNCHRONIZE ) ) )
  100. #define KEY_ALL_ACCESS          (bitand(bitor(bitor(bitor(bitor(bitor(bitor(STANDARD_RIGHTS_ALL, KEY_QUERY_VALUE), KEY_SET_VALUE), KEY_CREATE_SUB_KEY), KEY_ENUMERATE_SUB_KEYS), KEY_NOTIFY), KEY_CREATE_LINK), BITNOT(SYNCHRONIZE)))
  101.  
  102. //#define KEY_READ                ((STANDARD_RIGHTS_READ | KEY_QUERY_VALUE | KEY_ENUMERATE_SUB_KEYS | KEY_NOTIFY) & (~SYNCHRONIZE))
  103. //#define KEY_WRITE               ((STANDARD_RIGHTS_WRITE | KEY_SET_VALUE | KEY_CREATE_SUB_KEY) & (~SYNCHRONIZE))
  104. //#define KEY_EXECUTE             ((KEY_READ) & (~SYNCHRONIZE))
  105. //#define KEY_ALL_ACCESS          BITXOR( BITOR( BITOR( BITOR( BITOR( BITOR( BITOR( STANDARD_RIGHTS_ALL, KEY_QUERY_VALUE ), KEY_SET_VALUE ), KEY_CREATE_SUB_KEY ), KEY_ENUMERATE_SUB_KEYS ), KEY_NOTIFY ), KEY_CREATE_LINK ), SYNCHRONIZE)
  106.  
  107. //
  108. // Open/Create Options
  109. //
  110.  
  111. #define REG_OPTION_RESERVED         (0x00000000)   /* Parameter is reserved */
  112. #define REG_OPTION_NON_VOLATILE     (0x00000000)   /* Key is preserved */
  113.                                                    /* when system is rebooted */
  114. #define REG_OPTION_VOLATILE         (0x00000001)   /* Key is not preserved */
  115.                                                    /* when system is rebooted */
  116. #define REG_OPTION_CREATE_LINK      (0x00000002)   /* Created key is a */
  117.                                                    /* symbolic link */
  118. #define REG_OPTION_BACKUP_RESTORE   (0x00000004)   /* open for backup or restore */
  119.                                                    /* special access rules */
  120.                                                    /* privilege required */
  121.  
  122. #define REG_LEGAL_OPTION            (bitor(bitor(bitor(bitor(REG_OPTION_RESERVED, REG_OPTION_NON_VOLATILE), REG_OPTION_VOLATILE), REG_OPTION_CREATE_LINK), REG_OPTION_BACKUP_RESTORE))
  123.  
  124. //
  125. // Key creation/open disposition
  126. //
  127.  
  128. #define REG_CREATED_NEW_KEY         (0x00000001)   // New Registry Key created
  129. #define REG_OPENED_EXISTING_KEY     (0x00000002)   // Existing Key opened
  130.  
  131. //
  132. // Predefined Value Types.
  133. //
  134.  
  135. #define REG_NONE                    (0)   // No value type
  136. #define REG_SZ                      (1)   // Unicode nul terminated string
  137. #define REG_EXPAND_SZ               (2)   // Unicode nul terminated string
  138.                                             // (with environment variable references)
  139. #define REG_BINARY                  (3)   // Free form binary
  140. #define REG_DWORD                   (4)   // 32-bit number
  141. #define REG_DWORD_LITTLE_ENDIAN     (4)   // 32-bit number (same as REG_DWORD)
  142. #define REG_DWORD_BIG_ENDIAN        (5)   // 32-bit number
  143. #define REG_LINK                    (6)   // Symbolic Link (unicode)
  144. #define REG_MULTI_SZ                (7)   // Multiple Unicode strings
  145. #define REG_RESOURCE_LIST           (8)   // Resource list in the resource map
  146. #define REG_FULL_RESOURCE_DESCRIPTOR (9)  // Resource list in the hardware description
  147. #define REG_RESOURCE_REQUIREMENTS_LIST (10)
  148.  
  149. // From winerror.h
  150. //
  151. // MessageId: ERROR_SUCCESS
  152. //
  153. // MessageText:
  154. //
  155. //  The operation completed successfully.
  156. //
  157. #define ERROR_SUCCESS                    0
  158.  
  159. //
  160. // MessageId: ERROR_MORE_DATA
  161. //
  162. // MessageText:
  163. //
  164. //  More data is available.
  165. //
  166. #define ERROR_MORE_DATA                  234 
  167.  
  168. //
  169. // MessageId: ERROR_NO_MORE_ITEMS
  170. //
  171. // MessageText:
  172. //
  173. //  No more data is available.
  174. //
  175. #define ERROR_NO_MORE_ITEMS               259
  176.  
  177.  
  178. #endif // _WINREG_
  179. #endif // WINNT_H
  180.